package me.zhengjie.domain;

import lombok.RequiredArgsConstructor;
import me.zhengjie.dto.Resp;
import me.zhengjie.dto.sqlServer.InBoundMission;
import me.zhengjie.dto.sqlServer.Inventory;
import me.zhengjie.repository.*;
import org.springframework.stereotype.Component;

import java.util.List;


@Component
@RequiredArgsConstructor
public class ExceptionalService {

    private final PalletRepository PalletRepository;
    private final InventoryRepository InventoryRepository;
    private final StorageRepository storageRepository;
    private final ProcesscardRepository processcardRepository;
    private final InBoundMissionRepository inBoundMissionRepository;

    /**
     * 盘点库存，通过载盘或者储位号查找对应的信息是否正确
     * @param palletCode 载盘编码
     * @param storageCode 储位编码
     * @return Resp
     */
    public Resp reviseInventory(String palletCode,String storageCode) {


        return null;
    }


    /**
     * 处理需要入库的载盘卡在入库口不动的问题，排查入库任务是否已经存在任务，任务载盘号时候与扫码口载盘号一致
     * 若不一致需要删除该条任务
     * @param missionCode 任务编码
     * @return Resp
     */
    public Integer deleteInBoundMission(String missionCode){
        return inBoundMissionRepository.deleteInBoundMissionByMissionCode(missionCode);
    }

    public List<InBoundMission> findNowInBoundMission(){
        return inBoundMissionRepository.findAll();
    }
}
